Trò chơi Tic-Tac-Toe, game đánh caro full source code
53.486 lượt xem;
- OnClickCallMethod.cs
- DemoFriendsAndCustomAuth /
- Demos /
- Photon Unity Networking /
- Assets /
- project /
1 using UnityEngine;
2 using System.Collections;
3
4 [RequireComponent(typeof(Collider))]
5 public class OnClickCallMethod : Photon.MonoBehaviour
6 {
7 public GameObject TargetGameObject;
8 public string TargetMethod;
9
10 // called by InputToEvent script if that's on a camera
11 public void OnClick()
12 {
13 if (this.TargetGameObject == null || string.IsNullOrEmpty(this.TargetMethod))
14 {
15 Debug.LogWarning(this + " can't call, cause GO or Method are empty.");
16 return;
17 }
18
19 this.TargetGameObject.SendMessage(this.TargetMethod);
20 }
21 }
2 using System.Collections;
3
4 [RequireComponent(typeof(Collider))]
5 public class OnClickCallMethod : Photon.MonoBehaviour
6 {
7 public GameObject TargetGameObject;
8 public string TargetMethod;
9
10 // called by InputToEvent script if that's on a camera
11 public void OnClick()
12 {
13 if (this.TargetGameObject == null || string.IsNullOrEmpty(this.TargetMethod))
14 {
15 Debug.LogWarning(this + " can't call, cause GO or Method are empty.");
16 return;
17 }
18
19 this.TargetGameObject.SendMessage(this.TargetMethod);
20 }
21 }
called by InputToEvent script if that's on a camera